<?php
/**
* 分类服务
*/
class MtCategorySvc extends MtCommon
{
    
    /** 创建药品分类
     * @param $app_poi_code APP方门店ID
     * @param $category_code 药品分类code
     * @param $category_name 药品分类名称
     * @param $sequence 药品分类排序
     */
    public function saveMedicineCat($app_poi_code, $category_code, $category_name, $sequence)
    {
        $data = array();
        $data['app_poi_code'] = $app_poi_code;
        $data['category_code'] = $category_code;
        $data['category_name'] = $category_name;
        $data['sequence'] = $sequence;

        return $data;
    }
    /** 
     * 发送创建药品分类
     */
    public function sendSaveMedicineCat($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("saveMedicineCat : " . json_encode($postData), "run", "channel_meituan");

        $res = $this->sendData('medicineCat/save', $postData, 'POST');

        $this->DLOG("saveMedicineCat_res : " . json_encode($res), "run", "channel_meituan");

        return $res;
    }

    /** 更新药品分类
     * @param $app_poi_code APP方门店ID
     * @param $category_code 药品分类code
     * @param $category_name 药品分类名称
     * @param $sequence 药品分类排序
     */
    public function updateMedicineCat($app_poi_code, $category_code, $category_name, $sequence)
    {
        $data = array();
        $data['app_poi_code'] = $app_poi_code;
        $data['category_code'] = $category_code;
        $data['category_name'] = $category_name;
        $data['sequence'] = $sequence;

        return $data;
    }
    /** 
     * 发送更新药品分类
     */
    public function sendUpdateMedicineCat($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("updateMedicineCat : " . json_encode($postData), "run", "channel_meituan");

        $res = $this->sendData('medicineCat/update', $postData, 'POST');

        $this->DLOG("updateMedicineCat_res : " . json_encode($res), "run", "channel_meituan");

        return $res;
    }

    /** 删除药品分类
     * @param $app_poi_code APP方门店ID
     * @param $category_code 药品分类code
     */
    public function deleteMedicineCat($app_poi_code, $category_code)
    {
        $data = array();
        $data['app_poi_code'] = $app_poi_code;
        $data['category_code'] = $category_code;

        return $data;
    }
    /** 
     * 发送删除药品分类
     */
    public function sendDeleteMedicineCat($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("deleteMedicineCat : " . json_encode($postData), "run", "channel_meituan");

        $res = $this->sendData('medicineCat/delete', $postData, 'POST');

        $this->DLOG("deleteMedicineCat_res : " . json_encode($res), "run", "channel_meituan");

        return $res;
    }

    /** 查询门店药品分类列表
     * @param $app_poi_code APP方门店ID
     */
    public function medicineCatList($app_poi_code)
    {
        $data = array();
        $data['app_poi_code'] = $app_poi_code;

        return $data;
    }
    /** 
     * 发送查询门店药品分类列表
     */
    public function sendMedicineCatList($data = array())
    {        
        $postData = $this->getPostData($data);

        $this->DLOG("medicineCatList : " . json_encode($postData), "run", "channel_meituan");

        $res = $this->sendData('medicineCat/list', $postData, 'GET');

        $this->DLOG("medicineCatList_res : " . json_encode($res), "run", "channel_meituan");

        return $res;
    }
}